/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package algorithm;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Lu
 */
public class ProblemData {

    private int polyRessourceNb, productNb, machineNb;
    private int tasks[][];

    public ProblemData(File file, int resourcesNb) {
        try {
            Scanner scanner = new Scanner(file);
            scanner.nextLine(); // Ignore first line.
            productNb = scanner.nextInt();
            machineNb = scanner.nextInt();
            tasks = new int[productNb][machineNb];

            for (int i = 0; i < productNb; i++) {
                for (int j = 0; j < machineNb; j++) {
                    tasks[i][j] = scanner.nextInt();
                }
            }
            polyRessourceNb = resourcesNb;
        } catch (FileNotFoundException ex) {
            Logger.getLogger(ProblemData.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public int getPolyRessourceNb() {
        return polyRessourceNb;
    }

    public int getProductNb() {
        return productNb;
    }

    public int getMachineNb() {
        return machineNb;
    }

    public int getTask(int product, int machine) {
        return tasks[product-1][machine-1];
    }

    public int[][] getTasks() {
        return tasks;
    }
}
